<template>
<el-card>
  <!-- 提交资料 -->
  <div class="changeapply">
    <!-- 公益金设置 -->
    <!-- <h3 class="applyRecode">公益金设置</h3> -->
    <el-form class="form1 form3 form4" :model="bisicmsg" :disabled="this.look == 0" :rules="rules2" ref="bisicmsg" label-width="164px">
      <!-- 编辑是pwfPercentageNew -->
      <!-- <el-form-item v-if="this.num == 1" size="small" label="公益金比例（%:）" prop="pwfPercentageNew">
        <el-input placeholder="请输入公益金比例" v-model="bisicmsg.pwfPercentageNew"  @change = "changePercentageNew"></el-input>
      </el-form-item>
      <el-form-item v-else size="small" label="公益金比例（%:）" prop="pwfPercentage">
        <el-input placeholder="请输入公益金比例" v-model="bisicmsg.pwfPercentage"></el-input>
      </el-form-item>
      <el-form-item size="small" class="pubselect" label="选择公益项目：" prop="pwfProjectId">
        <el-select class="publis" v-model="bisicmsg.pwfProjectId" placeholder="请选择">
          <el-option v-for="benifit in benifits" :key="benifit.projectId" :label="benifit.projectName" :value="`${benifit.projectId}`"></el-option>
        </el-select>
        <span class="jing">当选择的公益项目失效后，默认选择为捐赠到善源基金会</span>
      </el-form-item>
      <div class="red" v-if="this.verifyState == 3">驳回理由：<span>{{bisicmsg.pwfInfoRefuseReason}}</span></div> -->
      <!-- 企业基本信息 -->
      <h3 class="applyRecode">企业基本信息</h3>
      <el-form-item size="small" label="企业名称：" prop="merchantName">
        <el-input placeholder="请输入企业名称" maxlength="50" v-model="bisicmsg.merchantName"></el-input>
      </el-form-item>
      <el-form-item class="introduce" label="企业介绍：" prop="companyIntroduction">
        <el-input type="textarea" :rows="3" placeholder="请输入企业介绍" maxlength="300" v-model="bisicmsg.companyIntroduction"></el-input>
      </el-form-item>
      <el-form-item class="doscale" label="经营范围：" prop="companyBusinessScope">
        <el-input type="textarea" :rows="3" placeholder="请输入经营范围" maxlength="200" v-model="bisicmsg.companyBusinessScope"></el-input>
      </el-form-item>
      <el-form-item size="small" label="法定代表人：" prop="companyLegalPerson">
        <el-input placeholder="请输入法定代表人" maxlength="20" v-model="bisicmsg.companyLegalPerson"></el-input>
      </el-form-item>
      <el-form-item size="small" label="注册资本（万元）：" prop="companyRegCapital">
        <el-input placeholder="请输入注册资本" maxlength="18" v-model="bisicmsg.companyRegCapital"></el-input>
      </el-form-item>
      <el-form-item size="small" label="成立时间：" prop="companyEstablistTime">
        <el-col :span="6">
            <el-date-picker v-model="bisicmsg.companyEstablistTime" type="date" placeholder="选择成立时间"></el-date-picker>
        </el-col>
      </el-form-item>
      <div class="proces">
        <el-form-item size="small" class="local1" label="营业执照所在地：" prop="businessLicenceProvince">
          <el-select @change="city(bisicmsg.businessLicenceProvince)" v-model="bisicmsg.businessLicenceProvince" placeholder="请选择省">
            <el-option v-for="item in vinces" :key="item.areaId" :label="item.areaName" :value="`${item.areaId}`"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item size="small" class="local2" label="" prop="businessLicenceCity">
          <el-select @change="qu(bisicmsg.businessLicenceCity)" v-model="bisicmsg.businessLicenceCity" placeholder="请选择市">
            <el-option v-for="item in shis" :key="item.areaId" :label="item.areaName" :value="`${item.areaId}`"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item size="small" class="local3" label="" prop="businessLicenceCounty">
          <el-select class="" v-model="bisicmsg.businessLicenceCounty" placeholder="请选择县区">
            <el-option v-for="item in qus" :key="item.areaId" :label="item.areaName" :value="`${item.areaId}`"></el-option>
          </el-select>
        </el-form-item>
      </div>
      <el-form-item size="small" label="营业执照详细地址：" prop="businessLicenceAddress">
        <el-input placeholder="请输入营业执照详细地址" maxlength="255" v-model="bisicmsg.businessLicenceAddress"></el-input>
      </el-form-item>
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.baseInfoRefuseReason}}</span></div>
      <!-- 企业资质信息 -->
      <h3 class="applyRecode">企业资质信息</h3>
      <el-form-item size="small" label="执照类型：" prop="businessLicenceType">
        <el-radio-group v-model="bisicmsg.businessLicenceType">
          <el-radio label="1">多证合一营业执照</el-radio>
          <el-radio label="2">普通营业执照</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item size="small" class="licensePic" label="营业执照照片：" prop="businessLicencePic">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='mgdata'
          :on-success="handleAvatarSuccess"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.businessLicencePic" :src="bisicmsg.businessLicencePic" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item>
      <el-form-item size="small" label="营业执照注册号：" prop="businessLicenceRegNo">
        <el-input placeholder="请输入营业执照注册号" maxlength="18" v-model="bisicmsg.businessLicenceRegNo"></el-input>
      </el-form-item>
      <el-form-item class="dates lia" label="营业期限：" prop="busying">
        <el-date-picker
            v-model="bisicmsg.busying"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
        </el-date-picker>
        <el-checkbox class="longtime" v-model="bisicmsg.businessDateIsLong" true-label="1" false-label="0">长期</el-checkbox>
      </el-form-item>
      <el-form-item size="small" v-if="this.bisicmsg.businessLicenceType === '2'" class="licensePic" label="税务登记照：" prop="taxRegPic">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='mgdata'
          :on-success="handleAvatarSuccess1"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.taxRegPic" :src="bisicmsg.taxRegPic" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item>
      <el-form-item size="small" v-if="this.bisicmsg.businessLicenceType === '2'" label="税字号：" prop="taxRegNo">
        <el-input placeholder="请输入税字号" v-model="bisicmsg.taxRegNo" maxlength="18"></el-input>
      </el-form-item>
      <el-form-item class="pubselect" v-if="this.bisicmsg.businessLicenceType === '2'" prop="taxIssueDate" label="发证日期：">
        <el-col :span="6">
          <el-date-picker v-model="bisicmsg.taxIssueDate" type="date" placeholder="选择发证日期"></el-date-picker>
        </el-col>
      </el-form-item>
      <el-form-item size="small" class="licensePic" v-if="this.bisicmsg.businessLicenceType === '2'" label="组织机构代码照片：" prop="orgCodePic">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='mgdata'
          :on-success="handleAvatarSuccess2"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.orgCodePic" :src="bisicmsg.orgCodePic" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item>
      <el-form-item size="small" v-if="this.bisicmsg.businessLicenceType === '2'" label="组织机构代码：" prop="orgCode">
        <el-input placeholder="请输入组织机构代码" v-model="bisicmsg.orgCode"></el-input>
      </el-form-item>
      <el-form-item class="dates" v-if="this.bisicmsg.businessLicenceType === '2'" label="组织机构代码有效期：" prop="orgnize">
        <el-date-picker
          v-model="bisicmsg.orgnize"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
        <el-checkbox class="longtime" v-model="bisicmsg.orgCodeDateIsLong" true-label="1" false-label="0">长期</el-checkbox>
      </el-form-item>
      <div style="display:flex;margin-top:12px">
        <el-form-item size="small" class="licensePic minibo" label="企业法人身份证正反面照片：" prop="clpIdPhotoFront">
          <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
            :show-file-list="false"
            :data='cardata'
            :on-success="handleAvatarSuccess3"
            :before-upload="beforeAvatarUpload">
            <img v-if="bisicmsg.clpIdPhotoFront" :src="bisicmsg.clpIdPhotoFront" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item size="small" class="licensePic minibo" label="" prop="clpIdPhotoBack">
          <!-- <div class="twoface"> -->
          <el-upload class="avatar-uploader you uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
            :show-file-list="false"
            :data='cardata'
            :on-success="handleAvatarSuccess4"
            :before-upload="beforeAvatarUpload">
            <img v-if="bisicmsg.clpIdPhotoBack" :src="bisicmsg.clpIdPhotoBack" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
          <!-- </div> -->
        </el-form-item>
      </div>
      <div class="redic" style="margin:24px 0px 10px 15px;">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
      <el-form-item size="small" label="企业法人身份证号码：" prop="clpIdNo">
        <el-input placeholder="请输入企业法人身份证号码" v-model="bisicmsg.clpIdNo"></el-input>
      </el-form-item>
      <el-form-item class="dates" label="身份证有效期：" prop = "idate">
         <el-date-picker
          v-model="bisicmsg.idate"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
        <el-checkbox class="longtime" v-model="bisicmsg.clpIdIsLong" true-label="1" false-label="0">长期</el-checkbox>
      </el-form-item>
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.qualInfoRefuseReason}}</span></div>
      <!-- 企业纳税信息 -->
      <h3 class="applyRecode">企业纳税信息</h3>
      <el-form-item size="small" label="企业纳税类型：" prop="enterprisesTaxType">
        <el-radio-group v-model="bisicmsg.enterprisesTaxType">
          <el-radio label="1">小规模纳税人</el-radio>
          <el-radio label="2">一般纳税人</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item size="small" class="licensePic" label="一般纳税人资质照片：" prop="generalTaxpayerQualificationPic">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='mgdata'
          :on-success="handleAvatarSuccess5"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.generalTaxpayerQualificationPic" :src="bisicmsg.generalTaxpayerQualificationPic" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item>
      <!-- <el-form-item size="small" label="证件号：" prop="grqNo">
        <el-input placeholder="请输入证件号" maxlength="18" v-model="bisicmsg.grqNo"></el-input>
      </el-form-item>
      <el-form-item class="dates lia" label="有效期：" prop="cardate">
        <el-date-picker
          v-model="bisicmsg.cardate"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
        <el-checkbox class="longtime" v-model="bisicmsg.grqDateIsLong" true-label="1" false-label="0">长期</el-checkbox>
      </el-form-item> -->
      <el-form-item size="small" class="licensePic" label="银行开户许可照片：" prop="baolPic">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='mgdata'
          :on-success="handleAvatarSuccess6"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.baolPic" :src="bisicmsg.baolPic" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item>
      <el-form-item size="small" label="核准号：" prop="baolApprovalNumber">
        <el-input placeholder="请输入核准号" maxlength="12" v-model="bisicmsg.baolApprovalNumber"></el-input>
      </el-form-item>
      <!-- <el-form-item class="dates" label="有效期：" prop="hedate">
        <el-date-picker
          v-model="bisicmsg.hedate"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
        <el-checkbox class="longtime" v-model="bisicmsg.baolDateIsLong" true-label="1" false-label="0">长期</el-checkbox>
      </el-form-item> -->
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.paytaxesInfoRefuseReason}}</span></div>
      <!-- 品牌信息 -->
      <h3 class="applyRecode">品牌信息</h3>
      <el-form-item size="small" label="品牌名称：" prop="brandName">
        <el-input placeholder="请输入品牌名称" v-model="bisicmsg.brandName"></el-input>
      </el-form-item>
      <el-form-item size="small" class="licensePic" label="品牌logo：" prop="brandLogo">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='logodata'
          :on-success="handleAvatarSuccess7"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.brandLogo" :src="bisicmsg.brandLogo" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item>
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.brandInfoRefuseReason}}</span></div>
      <!-- 商家信息 -->
        <h3 class="applyRecode">商家信息</h3>
        <el-form-item size="small" label="商家简称：" prop="merchantShortName">
          <el-input placeholder="" v-model="bisicmsg.merchantShortName"></el-input>
        </el-form-item>
        <el-form-item size="small" class="licensePic minibo" label="商家logo：" prop="merchantLogo">
          <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
              :show-file-list="false"
              :data='logodata'
              :on-success="hostSuccess"
              :before-upload="beforeAvatarUpload">
            <img v-if="bisicmsg.merchantLogo" :src="bisicmsg.merchantLogo" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
          </el-upload>
        </el-form-item>
        <el-form-item class="isdai" size="small" label="是否代理商：" prop="isAgent">
          <el-radio-group v-model="bisicmsg.isAgent">
            <el-radio label="1">是</el-radio>
            <el-radio label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item v-if="this.bisicmsg.isAgent == 1" size="small" class="licensePic minibo" label="" prop="powerOfAttorney">
          <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
                     :show-file-list="false"
                     :data='logodata'
                     :on-success="empowerSuccess"
                     :before-upload="beforeAvatarUpload">
            <div class="el-upload__tip redicon" slot="tip">
              <span style="color:#333">请上传委托授权书</span>
              <span style="margin-left:20px">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</span>
            </div>
            <img v-if="bisicmsg.powerOfAttorney" :src="bisicmsg.powerOfAttorney" class="avatar">
            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.merchantRefuseReason}}</span></div>
      <!-- 经营范围 -->
      <h3 class="applyRecode">经营范围</h3>
      <div class="addgoodstype">
        <el-button type="primary" @click="addpush" size="small">添加</el-button>
      </div>
      <!--<el-form-item size="small" class="pubselect" label="选择商品分类：" prop="businessGoodsClasses">
        <div class="wrap" v-for="(godtype, index) in arr" :key="index">
          <el-cascader
            :options="goodarr"
            v-model="godtype.businessGoodsClasses" :props = "props">
          </el-cascader>
          <el-button class="dele" @click="shan(index)" type="text">删除</el-button>
        </div>
      </el-form-item>
      <el-form-item size="small" label="平台服务费比例（%:）">
        <el-input placeholder="平台服务费比例" v-model="bisicmsg.platformFeeRatio"></el-input>
      </el-form-item>-->
      <el-table :data = "bisicmsg.arr" class = "content">
        <el-table-column label = "序号" align = "center">
          <template slot-scope="scope">{{ scope.$index + 1 }}</template>
        </el-table-column>
        <el-table-column label="商品分类" align = "center">
          <template slot-scope="scope">
            <el-form-item size="small" class="pubselect" label-width="0" :prop="`arr.${scope.$index}.businessGoodsClasses`" :rules="rules2.businessGoodsClasses">
              <el-cascader :options="goodarr" v-model="scope.row.businessGoodsClasses" :props = "props">
              </el-cascader>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="初始比例" align = "center">
          <template slot-scope="scope">
            <span v-if = "scope">1.00%</span>
          </template>
        </el-table-column>
        <el-table-column class="usrtage" label="商家比例" align = "center">
          <template slot-scope="scope">
            <el-form-item class="tageitm" size="small" :prop="`arr.${scope.$index}.platformFeeRatio`" label-width="0" :rules="rules2.platformFeeRatio">
              <el-input placeholder="平台服务费比例" v-model = "scope.row.platformFeeRatio" class = "input"/>%
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column align = "center">
          <template slot-scope="scope">
            <el-button class="dele" @click="shan(scope.$index)" type="text">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!-- <el-form-item size="small" class="licensePic" label="运营资质：" prop="operationalQualificationPic">
        <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
          :show-file-list="false"
          :data='mgdata'
          :on-success="handleAvatarSuccess0"
          :before-upload="beforeAvatarUpload">
          <img v-if="bisicmsg.operationalQualificationPic" :src="bisicmsg.operationalQualificationPic" class="avatar">
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
          <div class="el-upload__tip redicon" slot="tip">图片请确保800PX*800PX以上，文件大小在1MB以内，支持JPG、JPEG、Gif格式</div>
        </el-upload>
      </el-form-item> -->
      <!-- <el-form-item class="dates can" label="有效期：" required>
        <el-date-picker
          v-model="bisicmsg.yydate"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
        <el-checkbox class="longtime" v-model="bisicmsg.oqDateIsLong" true-label="1" false-label="0">长期</el-checkbox>
      </el-form-item> -->
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.businessGoodsClassesRefuseReason}}</span></div>
      <!-- 企业经营资质 -->
      <h3 class="applyRecode" style="margin-top:20px">企业经营资质</h3>
      <div class="addgoodstype">
        <el-button type="primary" @click="qiadd" size="small">添加</el-button>
        <span class="descrip">说明：证件上传，文件名称需按证件名称填写</span>
      </div>
      <el-table :data = "bisicmsg.qiarr" class = "content qiying">
        <el-table-column label = "序号" align = "center">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="资质类型" align = "center">
          <template slot-scope="scope">
            <el-form-item size="small" class="pubselect" label-width="0" :prop="`qiarr.${scope.$index}.qualification_type`" :rules="rules2.qualification_type">
              <el-select v-model="scope.row.qualification_type" placeholder="请选择">
                <el-option v-for="item in options"
                  :key="item.qualificationId" :label="item.qualificationName" :value="item.qualificationId">
                </el-option>
              </el-select>
              <!-- <el-cascader :options="qigoodarr" v-model="scope.row.businessGoodsClasses" :props = "props">
              </el-cascader> -->
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="有效期" align = "center">
          <template slot-scope="scope">
            <el-form-item class="qi" :prop="`qiarr.${scope.$index}.qualification_date`" :rules="rules2.qualification_date" label-width="0">
              <el-date-picker class="qidate" v-model="scope.row.qualification_date" type="date" placeholder="选择结束日期"></el-date-picker>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column class="zheng" label="证件上传" align = "center">
          <template slot-scope="scope">
            <el-form-item class="qizeng" :prop="`qiarr.${scope.$index}.qualification_pic`" :rules="rules2.qualification_pic" label-width="0">
              <div class="shach" @click="jingup(scope.$index)">
                <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
                  :show-file-list="false"
                  :data='mgdata'
                  :on-success="jingSuccess"
                  :before-upload="beforeAvatarUpload">
                  <img v-if="scope.row.qualification_pic" :src="scope.row.qualification_pic" class="avatar">
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                  <div class="">{{scope.row.boname}}</div>
                </el-upload>
              </div>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column align = "center">
          <template slot-scope="scope">
            <el-button class="dele" @click="qishan(scope.$index)" type="text">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.businessQualificationCompanyRefuseReason}}</span></div>
      <!-- 特殊品类商品资质 -->
      <h3 class="applyRecode" style="margin-top:20px">特殊品类商品资质</h3>
      <div class="addgoodstype">
        <el-button type="primary" @click="addSpecialArr" size="small">添加</el-button>
        <span class="descrip">说明：证件上传，文件名称需按证件名称填写</span>
      </div>
      <el-table :data = "bisicmsg.specialArr" class = "content qiying">
        <el-table-column label = "序号" align = "center">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="资质类型" align = "center">
          <template slot-scope="scope">
            <el-form-item size="small" class="pubselect" label-width="0" :prop="`specialArr.${scope.$index}.qualification`" :rules="rules2.qualification_special_type">
              <el-cascader
                :options="qualificationType"
                v-model="scope.row.qualification" :props="kindspros">
              </el-cascader>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column label="有效期" align = "center">
          <template slot-scope="scope">
            <el-form-item class="qi" :prop="`specialArr.${scope.$index}.qualification_date`" :rules="rules2.qualification_date" label-width="0">
              <el-date-picker style="width:180px" v-model="scope.row.qualification_date" type="date" placeholder="选择结束日期"></el-date-picker>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column class="zheng" label="证件上传" align = "center">
          <template slot-scope="scope">
            <el-form-item class="qizeng" :prop="`specialArr.${scope.$index}.qualification_pic`" :rules="rules2.qualification_pic" label-width="0">
              <div class="shach" @click="jingup(scope.$index)">
                <el-upload class="avatar-uploader uplod" :headers="Oimg" name="imageFile" :action="uploadUrl()"
                           :show-file-list="false"
                           :data='mgdata'
                           :on-success="jingSuccess1"
                           :before-upload="beforeAvatarUpload">
                  <img v-if="scope.row.qualification_pic" :src="scope.row.qualification_pic" class="avatar">
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                  <div class="">{{scope.row.boname1}}</div>
                </el-upload>
              </div>
            </el-form-item>
          </template>
        </el-table-column>
        <el-table-column align = "center">
          <template slot-scope="scope">
            <el-button class="dele" @click="qishanSpecial(scope.$index)" type="text">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="red" v-if="this.verifyState == 3 && this.look == 0">驳回理由：<span>{{bisicmsg.businessQualificationSpecialRefuseReason}}</span></div>
      <div class="protocol">
        <el-checkbox v-model="bisicmsg.merchantState" true-label="1" false-label="0"></el-checkbox>
        <div class="xieyi">
          我已阅读并同意<span>《XXXXXXXXX入驻协议》、</span><span>《XXXXXXXXX售后协议》</span>
        </div>
      </div>
    </el-form>
    <div class="buttons">
      <el-button type="primary" v-if="this.bisicmsg.merchantState == '1'" size="small" @click="cancel">取消</el-button>
      <el-button type="primary" v-if="this.bisicmsg.merchantState == '1'" @click="save(1)" size="small">保存并提交</el-button>
      <el-button type="primary" v-if="this.bisicmsg.merchantState == '1'" @click="save(0)" size="small">保存</el-button>
    </div>
  </div>
</el-card>
</template>
<script>
export default {
  name: 'changeapply',
  data () {
    return {
      boname: '',
      boname1: '',
      serviceIndex: '',
      mgdata: {
        folderType: 'certificate'
      },
      cardata: {
        folderType: 'member'
      },
      logodata: {
        folderType: 'logo'
      },
      Oimg: {},
      value6: '',
      look: '',
      num: '',
      statu: '',
      qualificationType: [],
      kindspros: {
        label: 'qualificationName',
        value: 'qualificationId',
        children: 'businessQualificationList'
      },
      options: [],
      goodarr: [],
      benifits: [],
      verifyState: '',
      bisicmsg: {
        //驳回理由
        arr: [{
          businessGoodsClasses: [],
          platformFeeRatio: ''
        }],
        qiarr: [{
          no: '1',
          qualification_type: '',
          qualification_date: '',
          qualification_pic: ''
        }],
        specialArr: [],
        pwfInfoRefuseReason: '',
        baseInfoRefuseReason: '',
        qualInfoRefuseReason: '',
        brandInfoRefuseReason: '',
        merchantRefuseReason: '',
        businessGoodsClassesRefuseReason: '',
        businessQualificationCompanyRefuseReason: '',
        businessQualificationSpecialRefuseReason: '',
        paytaxesInfoRefuseReason: '',
        oqRefuseReason: '',
        pwfPercentageNew: '',
        // 公益金设置
        pwfPercentage: '',
        pwfProjectId: '',
        //企业基本信息
        merchantName: '',
        companyIntroduction: '',
        companyBusinessScope: '',
        companyLegalPerson: '',
        companyRegCapital: '',
        companyEstablistTime: '',
        businessLicenceProvince: '',
        businessLicenceCity: '',
        businessLicenceCounty: '',
        businessLicenceAddress: '',
        //企业资质信息
        businessLicenceType: '',
        businessLicencePic: '',
        dialogVisible: false,
        businessLicenceRegNo: '',
        busying: [],
        // businessLicenceDateStart: '',
        // businessLicenceDateEnd: '',
        businessDateIsLong: '0',
        taxRegPic: '',
        taxRegNo: '',
        taxIssueDate: '',
        orgCodePic: '',
        orgCode: '',
        orgnize: [],
        // orgCodeDateStart: '',
        // orgCodeDateEnd: '',
        orgCodeDateIsLong: '0',
        clpIdPhotoFront: '',
        clpIdPhotoBack: '',
        clpIdNo: '',
        idate: [],
        // clpIdDateStart: '',
        // clpIdDateEnd: '',
        clpIdIsLong: 0,
        //企业纳税信息
        enterprisesTaxType: '',
        generalTaxpayerQualificationPic: '',
        grqNo: '',
        cardate: [],
        // grqDateStart: '',
        // grqDateEnd: '',
        grqDateIsLong: '0',
        baolPic: '',
        baolApprovalNumber: '',
        hedate: [],
        // baolDateStart: '',
        // baolDateEnd: '',
        baolDateIsLong: '0',
        //品牌信息
        brandName: '',
        brandLogo: '',
        merchantState: '0',
        //商家信息
        merchantShortName: '',
        merchantLogo: '',
        isAgent: '',
        powerOfAttorney: '',
        //经营范围
        platformFeeRatio: '',
        operationalQualificationPic: '',
        yydate: [],
        // oqDateStart: '',
        // oqDateEnd: '',
        oqDateIsLong: '0',
        proradio: false
      },
      vinces: [],
      shis: [],
      props: {
        label: 'className',
        value: 'classId',
        children: 'goodsClassList'
      },
      qus: [],
      rules2: {
        pwfPercentageNew: [
          { required: true, message: '请输入公益金比例', trigger: 'blur' },
          { pattern: /^\d+\.\d{2,5}$/, message: '格式不正确', trigger: 'blur' }
        ],
        //公益金设置
        pwfPercentage: [
          { required: true, message: '请输入公益金比例', trigger: 'blur' },
          { pattern: /^[1-9][0-9]{0,1}$/, message: '格式不正确', trigger: 'blur' }
        ],
        pwfProjectId: [
          { required: true, message: '请选择公益项目', trigger: 'change' }
        ],
        //企业基本信息
        merchantName: [
          { required: true, message: '请输入企业名称', trigger: 'blur' }
        ],
        companyIntroduction: [
          { required: true, message: '请输入企业介绍', trigger: 'blur' }
        ],
        companyBusinessScope: [
          { required: true, message: '请输入经营范围', trigger: 'blur' }
        ],
        companyLegalPerson: [
          { required: true, message: '请输入法定代理人', trigger: 'blur' }
        ],
        companyRegCapital: [
          { required: true, message: '请输入注册资本', trigger: 'blur' },
          { pattern: /^[0-9]{2,18}$/, message: '格式不正确', trigger: 'blur' }
        ],
        companyEstablistTime: [
          { type: 'date', required: true, message: '请输入成立时间', trigger: 'blur' }
        ],
        businessLicenceProvince: [
          { required: true, message: '请选择省', trigger: 'change' }
        ],
        businessLicenceCity: [
          { required: true, message: '请选择市', trigger: 'change' }
        ],
        businessLicenceCounty: [
          { required: true, message: '请选择区县', trigger: 'change' }
        ],
        businessLicenceAddress: [
          { required: true, message: '请输入营业执照详细地址', trigger: 'blur' }
        ],
        //企业资质信息
        businessLicenceType: [
          { required: true, message: '请选择执照类型', trigger: 'change' }
        ],
        businessLicencePic: [
          { required: true, message: '请上传营业执照照片' }
        ],
        businessLicenceRegNo: [
          { required: true, message: '请输入营业执照注册号', trigger: 'blur' },
          { pattern: /^[0-9]{15,18}$/, message: '格式不正确', trigger: 'blur' }
        ],
        busying: [
          { type: 'array', required: true, message: '请选择营业期限', trigger: 'blur' },
          { validator: this.checkBusYing, trigger: 'blur' }
        ],
        taxRegPic: [
          { required: true, message: '请上传税务登记照' }
        ],
        taxRegNo: [
          { required: true, message: '请输入税字号', trigger: 'blur' },
          { pattern: /^(\d{15}|\d{18})$/, message: '格式不正确', trigger: 'blur' }
        ],
        taxIssueDate: [
          { type: 'date', required: true, message: '请选择发证日期', trigger: 'change' }
        ],
        orgCodePic: [
          { required: true, message: '请上传组织机构代码照片' }
        ],
        orgCode: [
          { required: true, message: '请输入组织机构代码', trigger: 'blur' },
          { pattern: /^\d{8}-[0-9]$/ig, message: '格式不正确', trigger: 'blur' }
        ],
        orgnize: [
          { type: 'array', required: true, message: '请选择组织机构代码有效期', trigger: 'blur' }
        ],
        clpIdPhotoFront: [
          { required: true, message: '请上传身份证正面照' }
        ],
        clpIdPhotoBack: [
          { required: true, message: '请上传身份证反面照' }
        ],
        clpIdNo: [
          { required: true, message: '请输入企业法人身份证号码', trigger: 'blur' },
          { pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号码格式不正确', trigger: 'blur' }
        ],
        //企业纳税信息
        generalTaxpayerQualificationPic: [
          { required: true, message: '请上传一般纳税人资质照片' }
        ],
        enterprisesTaxType: [
          { required: true, message: '请选择企业纳税类型', trigger: 'change' }
        ],
        grqNo: [
          { required: true, message: '请输入证件号', trigger: 'blur' },
          { pattern: /^[0-9a-zA-Z]{15,18}$/, message: '格式不正确', trigger: 'blur' }
        ],
        cardate: [
          { type: 'array', required: true, message: '请选择有效期', trigger: 'blur' }
        ],
        baolPic: [
          { required: true, message: '请上传银行开户许可照片' }
        ],
        baolApprovalNumber: [
          { required: true, message: '请输入核准号', trigger: 'blur' },
          { pattern: /^[J,L,Z]\d{11}$/ig, message: '格式不正确', trigger: 'blur' }
        ],
        hedate: [
          { type: 'array', required: true, message: '请选择有效期', trigger: 'blur' }
        ],
        //品牌信息
        brandName: [
          { required: true, message: '请输入品牌名称', trigger: 'blur' }
        ],
        brandLogo: [
          { required: true, message: '请上传品牌logo' }
        ],
        //商家信息
        merchantShortName: [
          { required: true, message: '请输入商家简称', trigger: 'blur' }
        ],
        merchantLogo: [
          { required: true, message: '请上传' }
        ],
        isAgent: [
          { required: true, message: '请选择是否代理商', trigger: 'change' }
        ],
        powerOfAttorney: [
          { required: true, message: '请上传' }
        ],
        //经营范围
        businessGoodsClasses: [
          { validator: this.checkAge, trigger: 'change' }
        ],
        platformFeeRatio: [
          { required: true, message: '请输入商家比例', trigger: 'blur' },
          { pattern: /^[0-9]+([.]{1}[0-9]{1,2})?$/, message: '格式不正确', trigger: 'blur' }
        ],
        operationalQualificationPic: [
          { required: true, message: '请上传' }
        ],
        idate: [{ type: 'array', required: true, message: '请选择身份证有效期', trigger: 'blur' }],
        yydate: [
          { type: 'array', required: true, message: '请选择有效期', trigger: 'blur' }
        ],
        //企业经营资质
        qualification_type: [
          { required: true, message: '请选择资质类型', trigger: 'change' }
        ],
        qualification_special_type: [
          { required: true, message: '请选择资质类型', trigger: 'change' }
        ],
        qualification_date: [
          { type: 'date', required: true, message: '请选择有效期', trigger: 'change' }
        ],
        qualification_pic: [
          { required: true, message: '请上传' }
        ]
      }
    }
  },
  created () {
    this.Oimg['x-auth-token'] = `${this.$store.state.systemId}_${this.$store.state.userId}_${this.$store.state.token}`
    this.look = this.$route.query.look * 1
    this.num = this.$route.query.nu * 1
    this.statu = this.$route.query.statu
    this.projec()
    this.sheng()
    this.goodtype()
    if (this.look === 0 || this.num === 1) {
      this.init()
    }
    this.qualifite()
    this.spekind()
  },
  methods: {
    checkArr (arr, qualificationType) {
      let len = Array.from(new Set(arr.map(item => {
        // console.log(qualificationType)
        return JSON.stringify(item[qualificationType])
      }))).length
      return arr.length === len
    },
    //企业运营资质
    qualifite () {
      this.$tkAjax.get(`${this.$config.baseUrl}/merchant/businessQualification/getAllBusinessQualification`, {
        params: {
          qualificationType: '1'
        }
      }).then(res => {
        this.options = res.data.content
      }).catch(err => {
        this.$message.warning(err.data.message)
      })
    },
    //特殊品类
    spekind () {
      this.$tkAjax.get(`${this.$config.baseUrl}/merchant/businessQualification/getAllBusinessQualification`, {
        params: {
          qualificationType: '2'
        }
      }).then(res => {
        res.data.content = JSON.parse(JSON.stringify(res.data.content).replace(/\[\]/img, 'null'))
        if (Array.isArray(res.data.content)) {
          this.qualificationType = res.data.content
        }
      }).catch(err => {
        this.$message.warning(err.data.message)
      })
    },
    uploadUrl () {
      return `${this.$config.baseUrl}/system/imageUpload`
    },
    changeZitext (opt) {
      if (opt.qualification_type === '0') {
        opt.certificate = []
      }
    },
    //选择公益项目
    projec () {
      if (this.num === 2) {
        this.$tkAjax.get(`${this.$config.baseUrl}/merchant/getWelfareProject`, {}, {
          params: {
            projectId: this.bisicmsg.pwfProjectId
          }
        }).then(res => {
          this.benifits = res.data.content
        }).catch(err => {
          this.$message.warning(err.data.message)
        })
      } else {
        this.$tkAjax.get(`${this.$config.baseUrl}/merchant/getWelfareProject`, {}, {
          params: {
            projectId: ''
          }
        }).then(res => {
          // console.log(res)
          this.benifits = res.data.content
        }).catch(err => {
          this.$message.warning(err.data.message)
        })
      }
    },
    //省级联动
    checkAge (rule, value, callback) {
      let index = this.bisicmsg.arr.findIndex(item => {
        return !item.businessGoodsClasses
      })
      let arr = this.bisicmsg.arr.map(item => {
        return item.businessGoodsClasses.join(',')
      })
      arr = Array.from(new Set(arr))
      if (index !== -1) {
        callback(new Error('请选择商品分类'))
      } else if (arr.length < this.bisicmsg.arr.length) {
        callback(new Error('请勿选择相同的商品分类'))
      } else {
        callback()
      }
    },
    checkBusYing (rule, value, callback) {
      if (!Array.isArray(value)) {
        callback(new Error('请选择营业期限'))
      }
      let index = value.findIndex(item => {
        return !item
      })
      if (index !== -1) {
        callback(new Error('请选择营业期限'))
      } else {
        callback()
      }
    },
    sheng () {
      let json = {
        pid: '0'
      }
      this.$tkAjax.get(`${this.$config.baseUrl}/system/area/getAreaWithCascade`, {
        params: json
      }).then(res => {
        this.vinces = res.data.content
      }).catch(err => {
        this.$message.warning(err.data.message)
      })
    },
    city (shengcode, state) {
      let json = {
        pid: shengcode
      }
      this.$tkAjax.get(`${this.$config.baseUrl}/system/area/getAreaWithCascade`, {
        params: json
      }).then(res => {
        this.shis = res.data.content
        if (!state) {
          this.bisicmsg.businessLicenceCity = ''
          this.bisicmsg.businessLicenceCounty = ''
        }
      }).catch(err => {
        this.$message.warning(err.data.message)
      })
    },
    qu (code, state) {
      let json = {
        pid: code
      }
      this.$tkAjax.get(`${this.$config.baseUrl}/system/area/getAreaWithCascade`, {
        params: json
      }).then(res => {
        this.qus = res.data.content
        if (!state) {
          this.bisicmsg.businessLicenceCounty = ''
        }
      }).catch(err => {
        this.$message.warning(err.data.message)
      })
    },
    //商品分类,
    goodtype () {
      this.$tkAjax.post(`${this.$config.baseUrl}/goods/goodsClass/getGoodsClassByCondition`, {}, {
        params: {
          condition: {
            classLevel: 1,
            classStatus: 1
          }
        }
      }).then(res => {
        res.data.content = JSON.parse(JSON.stringify(res.data.content).replace(/\[\]/img, 'null'))
        if (Array.isArray(res.data.content)) {
          this.goodarr = res.data.content.map(item => {
            return item
          })
        }
        // this.$message.warning(res.data.message)
      }).catch(err => {
        console.log(err)
        this.$message.warning(err.data.message)
      })
    },
    //删除每一个商品
    shan (index) {
      if (this.bisicmsg.arr.length > 1) {
        this.bisicmsg.arr.splice(index, 1)
        this.$refs.bisicmsg.clearValidate(['businessGoodsClasses'])
      } else {
        this.$message.warning('最少有一个')
      }
    },
    //点击编辑 保存
    edit () {
      if (!this.checkArr(this.bisicmsg.specialArr, 'qualification')) {
        this.$message.warning('特殊品类商品资质类型不能重复')
        return false
      }
      if (!this.checkArr(this.bisicmsg.qiarr, 'qualification_type')) {
        this.$message.warning('企业运营资质类型不能重复')
        return false
      }
      // if (!this.checkArr(this.bisicmsg.specialArr)) {
      //   this.$message.warning('特殊品类商品资质类型不能重复')
      //   return false
      // }
      // if (!this.checkArr(this.bisicmsg.qiarr)) {
      //   this.$message.warning('企业运营资质类型不能重复')
      //   return false
      // }
      if (this.num === 1) {
        let businessGoodsClasses = this.bisicmsg.arr.map(item => {
          return item.businessGoodsClasses.join('/') + '&*&' + item.platformFeeRatio
        }).join(',')
        let json = {
          applyRecordId: this.$route.query.id,
          pwfInfoRefuseReason: this.bisicmsg.pwfInfoRefuseReason,
          baseInfoRefuseReason: this.bisicmsg.baseInfoRefuseReason,
          qualInfoRefuseReason: this.bisicmsg.qualInfoRefuseReason,
          brandInfoRefuseReason: this.bisicmsg.brandInfoRefuseReason,
          merchantRefuseReason: this.bisicmsg.merchantRefuseReason,
          businessGoodsClassesRefuseReason: this.bisicmsg.businessGoodsClassesRefuseReason,
          businessQualificationCompanyRefuseReason: this.bisicmsg.businessQualificationCompanyRefuseReason,
          businessQualificationSpecialRefuseReason: this.bisicmsg.businessQualificationSpecialRefuseReason,
          paytaxesInfoRefuseReason: this.bisicmsg.paytaxesInfoRefuseReason,
          oqRefuseReason: this.bisicmsg.oqRefuseReason,
          pwfPercentageNew: this.bisicmsg.pwfPercentageNew,
          pwfProjectId: this.bisicmsg.pwfProjectId,
          merchantName: this.bisicmsg.merchantName,
          companyIntroduction: this.bisicmsg.companyIntroduction,
          companyBusinessScope: this.bisicmsg.companyBusinessScope,
          companyLegalPerson: this.bisicmsg.companyLegalPerson,
          companyRegCapital: this.bisicmsg.companyRegCapital,
          companyEstablistTime: this.bisicmsg.companyEstablistTime,
          businessLicenceProvince: this.bisicmsg.businessLicenceProvince,
          businessLicenceCity: this.bisicmsg.businessLicenceCity,
          businessLicenceCounty: this.bisicmsg.businessLicenceCounty,
          businessLicenceAddress: this.bisicmsg.businessLicenceAddress,
          businessLicenceType: this.bisicmsg.businessLicenceType,
          businessLicencePic: this.setImgSrc(this.bisicmsg.businessLicencePic),
          businessLicenceRegNo: this.bisicmsg.businessLicenceRegNo,
          businessLicenceDateStart: this.bisicmsg.busying[0],
          businessLicenceDateEnd: this.bisicmsg.busying[1],
          businessDateIsLong: this.bisicmsg.businessDateIsLong,
          taxRegPic: this.setImgSrc(this.bisicmsg.businessLicencePic),
          taxRegNo: this.bisicmsg.taxRegNo,
          taxIssueDate: this.bisicmsg.taxIssueDate,
          orgCodePic: this.bisicmsg.orgCodePic,
          orgCode: this.bisicmsg.orgCode,
          orgCodeDateStart: this.bisicmsg.orgnize[0],
          orgCodeDateEnd: this.bisicmsg.orgnize[1],
          orgCodeDateIsLong: this.bisicmsg.orgCodeDateIsLong,
          clpIdPhotoFront: this.setImgSrc(this.bisicmsg.clpIdPhotoFront),
          clpIdPhotoBack: this.setImgSrc(this.bisicmsg.clpIdPhotoBack),
          clpIdNo: this.bisicmsg.clpIdNo,
          clpIdDateStart: this.bisicmsg.idate[0],
          clpIdDateEnd: this.bisicmsg.idate[1],
          clpIdIsLong: this.bisicmsg.clpIdIsLong,
          enterprisesTaxType: this.bisicmsg.enterprisesTaxType,
          generalTaxpayerQualificationPic: this.setImgSrc(this.bisicmsg.generalTaxpayerQualificationPic),
          grqNo: this.bisicmsg.grqNo,
          grqDateStart: this.bisicmsg.cardate[0],
          grqDateEnd: this.bisicmsg.cardate[1],
          grqDateIsLong: this.bisicmsg.grqDateIsLong,
          baolPic: this.setImgSrc(this.bisicmsg.baolPic),
          baolApprovalNumber: this.bisicmsg.baolApprovalNumber,
          baolDateStart: this.bisicmsg.hedate[0],
          baolDateEnd: this.bisicmsg.hedate[1],
          baolDateIsLong: this.bisicmsg.baolDateIsLong,
          businessGoodsClasses: businessGoodsClasses,
          platformFeeRatio: this.bisicmsg.platformFeeRatio,
          operationalQualificationPic: this.setImgSrc(this.bisicmsg.operationalQualificationPic),
          oqDateStart: this.bisicmsg.yydate[0],
          oqDateEnd: this.bisicmsg.yydate[1],
          oqDateIsLong: this.bisicmsg.oqDateIsLong,
          brandName: this.bisicmsg.brandName,
          brandLogo: this.setImgSrc(this.bisicmsg.brandLogo),
          // merchantState: this.bisicmsg.merchantState,
          merchantShortName: this.bisicmsg.merchantShortName,
          merchantLogo: this.bisicmsg.merchantLogo,
          isAgent: this.bisicmsg.isAgent,
          powerOfAttorney: this.bisicmsg.powerOfAttorney,
          businessQualificationCompany: this.bisicmsg.qiarr.map((item, index) => {
            item.no = index + 1
            return item
          }),
          businessQualificationSpecial: this.bisicmsg.specialArr.map((item, index) => {
            item.no = index + 1
            item.qualification_type = item.qualification.join('/')
            return item
          }),
          merchantUserId: this.$store.state.userId,
          verifyState: '0'
        }
        this.$tkAjax.post(`${this.$config.baseUrl}/merchant/merchantApplyRecord/updateMerchantApplyRecordById`, {}, {
          params: {
            condition: json,
            submitFlg: '0'
          }
        }).then(res => {
          this.$message.success(res.data.content)
          this.$router.push('/unsubmit')
        }).catch(err => {
          this.$message.warning(err.data.content)
        })
      }
    },
    //点击编辑 提交并保存
    edit1 () {
      if (!this.checkArr(this.bisicmsg.specialArr, 'qualification')) {
        this.$message.warning('特殊品类商品资质类型不能重复')
        return false
      }
      if (!this.checkArr(this.bisicmsg.qiarr, 'qualification_type')) {
        this.$message.warning('企业运营资质类型不能重复')
        return false
      }
      // if (!this.checkArr(this.bisicmsg.specialArr)) {
      //   this.$message.warning('特殊品类商品资质类型不能重复')
      //   return false
      // }
      // if (!this.checkArr(this.bisicmsg.qiarr)) {
      //   this.$message.warning('企业运营资质类型不能重复')
      //   return false
      // }
      if (this.num === 1) {
        let businessGoodsClasses = this.bisicmsg.arr.map(item => {
          return item.businessGoodsClasses.join('/') + '&*&' + item.platformFeeRatio
        }).join(',')
        let json = {
          applyRecordId: this.$route.query.id,
          pwfInfoRefuseReason: this.bisicmsg.pwfInfoRefuseReason,
          baseInfoRefuseReason: this.bisicmsg.baseInfoRefuseReason,
          qualInfoRefuseReason: this.bisicmsg.qualInfoRefuseReason,
          brandInfoRefuseReason: this.bisicmsg.brandInfoRefuseReason,
          merchantRefuseReason: this.bisicmsg.merchantRefuseReason,
          businessGoodsClassesRefuseReason: this.bisicmsg.businessGoodsClassesRefuseReason,
          businessQualificationCompanyRefuseReason: this.bisicmsg.businessQualificationCompanyRefuseReason,
          businessQualificationSpecialRefuseReason: this.bisicmsg.businessQualificationSpecialRefuseReason,
          paytaxesInfoRefuseReason: this.bisicmsg.paytaxesInfoRefuseReason,
          oqRefuseReason: this.bisicmsg.oqRefuseReason,
          pwfPercentageNew: this.bisicmsg.pwfPercentageNew,
          pwfProjectId: this.bisicmsg.pwfProjectId,
          merchantName: this.bisicmsg.merchantName,
          companyIntroduction: this.bisicmsg.companyIntroduction,
          companyBusinessScope: this.bisicmsg.companyBusinessScope,
          companyLegalPerson: this.bisicmsg.companyLegalPerson,
          companyRegCapital: this.bisicmsg.companyRegCapital,
          companyEstablistTime: this.bisicmsg.companyEstablistTime,
          businessLicenceProvince: this.bisicmsg.businessLicenceProvince,
          businessLicenceCity: this.bisicmsg.businessLicenceCity,
          businessLicenceCounty: this.bisicmsg.businessLicenceCounty,
          businessLicenceAddress: this.bisicmsg.businessLicenceAddress,
          businessLicenceType: this.bisicmsg.businessLicenceType,
          businessLicencePic: this.setImgSrc(this.bisicmsg.businessLicencePic),
          businessLicenceRegNo: this.bisicmsg.businessLicenceRegNo,
          businessLicenceDateStart: this.bisicmsg.busying[0],
          businessLicenceDateEnd: this.bisicmsg.busying[1],
          businessDateIsLong: this.bisicmsg.businessDateIsLong,
          taxRegPic: this.setImgSrc(this.bisicmsg.businessLicencePic),
          taxRegNo: this.bisicmsg.taxRegNo,
          taxIssueDate: this.bisicmsg.taxIssueDate,
          orgCodePic: this.bisicmsg.orgCodePic,
          orgCode: this.bisicmsg.orgCode,
          orgCodeDateStart: this.bisicmsg.orgnize[0],
          orgCodeDateEnd: this.bisicmsg.orgnize[1],
          orgCodeDateIsLong: this.bisicmsg.orgCodeDateIsLong,
          clpIdPhotoFront: this.setImgSrc(this.bisicmsg.clpIdPhotoFront),
          clpIdPhotoBack: this.setImgSrc(this.bisicmsg.clpIdPhotoBack),
          clpIdNo: this.bisicmsg.clpIdNo,
          clpIdDateStart: this.bisicmsg.idate[0],
          clpIdDateEnd: this.bisicmsg.idate[1],
          clpIdIsLong: this.bisicmsg.clpIdIsLong,
          enterprisesTaxType: this.bisicmsg.enterprisesTaxType,
          generalTaxpayerQualificationPic: this.setImgSrc(this.bisicmsg.generalTaxpayerQualificationPic),
          grqNo: this.bisicmsg.grqNo,
          grqDateStart: this.bisicmsg.cardate[0],
          grqDateEnd: this.bisicmsg.cardate[1],
          grqDateIsLong: this.bisicmsg.grqDateIsLong,
          baolPic: this.setImgSrc(this.bisicmsg.baolPic),
          baolApprovalNumber: this.bisicmsg.baolApprovalNumber,
          baolDateStart: this.bisicmsg.hedate[0],
          baolDateEnd: this.bisicmsg.hedate[1],
          baolDateIsLong: this.bisicmsg.baolDateIsLong,
          businessGoodsClasses: businessGoodsClasses,
          platformFeeRatio: this.bisicmsg.platformFeeRatio,
          operationalQualificationPic: this.setImgSrc(this.bisicmsg.operationalQualificationPic),
          oqDateStart: this.bisicmsg.yydate[0],
          oqDateEnd: this.bisicmsg.yydate[1],
          oqDateIsLong: this.bisicmsg.oqDateIsLong,
          brandName: this.bisicmsg.brandName,
          brandLogo: this.setImgSrc(this.bisicmsg.brandLogo),
          // merchantState: this.bisicmsg.merchantState,
          merchantShortName: this.bisicmsg.merchantShortName,
          merchantLogo: this.bisicmsg.merchantLogo,
          isAgent: this.bisicmsg.isAgent,
          powerOfAttorney: this.bisicmsg.powerOfAttorney,
          businessQualificationCompany: this.bisicmsg.qiarr.map((item, index) => {
            item.no = index + 1
            return item
          }),
          businessQualificationSpecial: this.bisicmsg.specialArr.map((item, index) => {
            item.no = index + 1
            item.qualification_type = item.qualification.join('/')
            return item
          }),
          merchantUserId: this.$store.state.userId,
          verifyState: '1'
        }
        this.$tkAjax.post(`${this.$config.baseUrl}/merchant/merchantApplyRecord/updateMerchantApplyRecordById`, {}, {
          params: {
            condition: json,
            submitFlg: '0'
          }
        }).then(res => {
          this.$message.success(res.data.content)
          this.$router.push('/unsubmit')
        }).catch(err => {
          this.$message.warning(err.data.content)
        })
      }
    },
    //保存
    save (ber) {
      // if (!this.checkArr(this.bisicmsg.specialArr)) {
      //   this.$message.warning('特殊品类商品资质类型不能重复')
      //   return false
      // }
      // if (!this.checkArr(this.bisicmsg.qiarr)) {
      //   this.$message.warning('企业运营资质类型不能重复')
      //   return false
      // }
      //判断是否选择协议
      if (this.bisicmsg.merchantState === '0') {
        this.$message.warning('您还未阅读协议！')
        return false
      }
      //判断是否选择重复的 商品分类
      // let arr = this.bisicmsg.arr.map(item => {
      //   return item.businessGoodsClasses.join('/')
      // })
      // arr = Array.from(new Set(arr))
      // if (arr.length !== this.bisicmsg.arr.length) {
      //   this.$message.warning('不能选择相同的分类')
      //   return false
      // }
      if (this.$route.query.nu) {
        this.$refs.bisicmsg.validate((valid) => {
          if (valid) {
            if (!this.checkArr(this.bisicmsg.specialArr, 'qualification')) {
              this.$message.warning('特殊品类商品资质类型不能重复')
              return false
            }
            if (!this.checkArr(this.bisicmsg.qiarr, 'qualification_type')) {
              this.$message.warning('企业运营资质类型不能重复')
              return false
            }
            if (ber === 0) {
              this.edit()
            } else if (ber === 1) {
              this.edit1()
            }
          }
        })
      } else {
        let businessGoodsClasses = this.bisicmsg.arr.map(item => {
          return item.businessGoodsClasses.join('/') + '&*&' + item.platformFeeRatio
        }).join(',')
        if (ber === 0) {
          this.$refs.bisicmsg.validate((valid) => {
            if (valid) {
              if (!this.checkArr(this.bisicmsg.specialArr, 'qualification')) {
                this.$message.warning('特殊品类商品资质类型不能重复')
                return false
              }
              if (!this.checkArr(this.bisicmsg.qiarr, 'qualification_type')) {
                this.$message.warning('企业运营资质类型不能重复')
                return false
              }
              let json = {
                pwfInfoRefuseReason: this.bisicmsg.pwfInfoRefuseReason,
                baseInfoRefuseReason: this.bisicmsg.baseInfoRefuseReason,
                qualInfoRefuseReason: this.bisicmsg.qualInfoRefuseReason,
                brandInfoRefuseReason: this.bisicmsg.brandInfoRefuseReason,
                merchantRefuseReason: this.bisicmsg.merchantRefuseReason,
                businessGoodsClassesRefuseReason: this.bisicmsg.businessGoodsClassesRefuseReason,
                businessQualificationCompanyRefuseReason: this.bisicmsg.businessQualificationCompanyRefuseReason,
                businessQualificationSpecialRefuseReason: this.bisicmsg.businessQualificationSpecialRefuseReason,
                paytaxesInfoRefuseReason: this.bisicmsg.paytaxesInfoRefuseReason,
                pwfPercentage: this.bisicmsg.pwfPercentage,
                pwfProjectId: this.bisicmsg.pwfProjectId,
                merchantName: this.bisicmsg.merchantName,
                companyIntroduction: this.bisicmsg.companyIntroduction,
                companyBusinessScope: this.bisicmsg.companyBusinessScope,
                companyLegalPerson: this.bisicmsg.companyLegalPerson,
                companyRegCapital: this.bisicmsg.companyRegCapital,
                companyEstablistTime: this.bisicmsg.companyEstablistTime,
                businessLicenceProvince: this.bisicmsg.businessLicenceProvince,
                businessLicenceCity: this.bisicmsg.businessLicenceCity,
                businessLicenceCounty: this.bisicmsg.businessLicenceCounty,
                businessLicenceAddress: this.bisicmsg.businessLicenceAddress,
                businessLicenceType: this.bisicmsg.businessLicenceType,
                // businessLicencePic: this.this.setImgSrc(this.bisicmsg.businessLicencePic),
                businessLicencePic: this.setImgSrc(this.setImgSrc(this.bisicmsg.businessLicencePic)),
                businessLicenceRegNo: this.bisicmsg.businessLicenceRegNo,
                businessLicenceDateStart: this.bisicmsg.busying[0],
                businessLicenceDateEnd: this.bisicmsg.busying[1],
                businessDateIsLong: this.bisicmsg.businessDateIsLong,
                taxRegPic: this.setImgSrc(this.bisicmsg.businessLicencePic),
                taxRegNo: this.bisicmsg.taxRegNo,
                taxIssueDate: this.bisicmsg.taxIssueDate,
                orgCodePic: this.bisicmsg.orgCodePic,
                orgCode: this.bisicmsg.orgCode,
                orgCodeDateStart: this.bisicmsg.orgnize[0],
                orgCodeDateEnd: this.bisicmsg.orgnize[1],
                orgCodeDateIsLong: this.bisicmsg.orgCodeDateIsLong,
                clpIdPhotoFront: this.bisicmsg.clpIdPhotoFront,
                clpIdPhotoBack: this.setImgSrc(this.bisicmsg.clpIdPhotoBack),
                clpIdNo: this.bisicmsg.clpIdNo,
                clpIdDateStart: this.bisicmsg.idate[0],
                clpIdDateEnd: this.bisicmsg.idate[1],
                clpIdIsLong: this.bisicmsg.clpIdIsLong,
                enterprisesTaxType: this.bisicmsg.enterprisesTaxType,
                generalTaxpayerQualificationPic: this.setImgSrc(this.bisicmsg.generalTaxpayerQualificationPic),
                grqNo: this.bisicmsg.grqNo,
                grqDateStart: this.bisicmsg.cardate[0],
                grqDateEnd: this.bisicmsg.cardate[1],
                grqDateIsLong: this.bisicmsg.grqDateIsLong,
                baolPic: this.setImgSrc(this.bisicmsg.baolPic),
                baolApprovalNumber: this.bisicmsg.baolApprovalNumber,
                baolDateStart: this.bisicmsg.hedate[0],
                baolDateEnd: this.bisicmsg.hedate[1],
                baolDateIsLong: this.bisicmsg.baolDateIsLong,
                businessGoodsClasses: businessGoodsClasses,
                platformFeeRatio: this.bisicmsg.platformFeeRatio,
                operationalQualificationPic: this.setImgSrc(this.bisicmsg.operationalQualificationPic),
                oqDateStart: this.bisicmsg.yydate[0],
                oqDateEnd: this.bisicmsg.yydate[1],
                oqDateIsLong: this.bisicmsg.oqDateIsLong,
                brandName: this.bisicmsg.brandName,
                brandLogo: this.setImgSrc(this.bisicmsg.brandLogo),
                // merchantState: '',
                merchantShortName: this.bisicmsg.merchantShortName,
                merchantLogo: this.bisicmsg.merchantLogo,
                isAgent: this.bisicmsg.isAgent,
                powerOfAttorney: this.bisicmsg.powerOfAttorney,
                businessQualificationCompany: this.bisicmsg.qiarr.map((item, index) => {
                  item.no = index + 1
                  return item
                }),
                businessQualificationSpecial: this.bisicmsg.specialArr.map((item, index) => {
                  item.no = index + 1
                  item.qualification_type = item.qualification.join('/')
                  return item
                }),
                merchantUserId: this.$store.state.userId
              }
              this.$tkAjax.post(`${this.$config.baseUrl}/merchant/saveMerchantByStr`, {}, {
                params: {
                  condition: json,
                  submitFlg: '0'
                }
              }).then(res => {
                console.log(res)
                this.$message.success(res.data.message)
                return this.$store.dispatch('getUserInfo', this.$store.state.userId)
              }).then(res => {
                // this.$message.success(res.data.message)
                this.$router.push('/unsubmit')
                //为商家申请记录页面 提供参数
                // this.$store.commit('setMerchant', res.data.content)
                // this.edit()
              }).catch(err => {
                this.$message.warning(err.data.message)
              })
            } else {
              console.log('error submit!!')
              return false
            }
          })
        } else if (ber === 1) {
          this.$refs.bisicmsg.validate((valid) => {
            if (valid) {
              if (!this.checkArr(this.bisicmsg.specialArr, 'qualification')) {
                this.$message.warning('特殊品类商品资质类型不能重复')
                return false
              }
              if (!this.checkArr(this.bisicmsg.qiarr, 'qualification_type')) {
                this.$message.warning('企业运营资质类型不能重复')
                return false
              }
              let json = {
                pwfInfoRefuseReason: this.bisicmsg.pwfInfoRefuseReason,
                baseInfoRefuseReason: this.bisicmsg.baseInfoRefuseReason,
                qualInfoRefuseReason: this.bisicmsg.qualInfoRefuseReason,
                brandInfoRefuseReason: this.bisicmsg.brandInfoRefuseReason,
                merchantRefuseReason: this.bisicmsg.merchantRefuseReason,
                businessGoodsClassesRefuseReason: this.bisicmsg.businessGoodsClassesRefuseReason,
                businessQualificationCompanyRefuseReason: this.bisicmsg.businessQualificationCompanyRefuseReason,
                businessQualificationSpecialRefuseReason: this.bisicmsg.businessQualificationSpecialRefuseReason,
                paytaxesInfoRefuseReason: this.bisicmsg.paytaxesInfoRefuseReason,
                pwfPercentage: this.bisicmsg.pwfPercentage,
                pwfProjectId: this.bisicmsg.pwfProjectId,
                merchantName: this.bisicmsg.merchantName,
                companyIntroduction: this.bisicmsg.companyIntroduction,
                companyBusinessScope: this.bisicmsg.companyBusinessScope,
                companyLegalPerson: this.bisicmsg.companyLegalPerson,
                companyRegCapital: this.bisicmsg.companyRegCapital,
                companyEstablistTime: this.bisicmsg.companyEstablistTime,
                businessLicenceProvince: this.bisicmsg.businessLicenceProvince,
                businessLicenceCity: this.bisicmsg.businessLicenceCity,
                businessLicenceCounty: this.bisicmsg.businessLicenceCounty,
                businessLicenceAddress: this.bisicmsg.businessLicenceAddress,
                businessLicenceType: this.bisicmsg.businessLicenceType,
                businessLicencePic: this.setImgSrc(this.bisicmsg.businessLicencePic),
                businessLicenceRegNo: this.bisicmsg.businessLicenceRegNo,
                businessLicenceDateStart: this.bisicmsg.busying[0],
                businessLicenceDateEnd: this.bisicmsg.busying[1],
                businessDateIsLong: this.bisicmsg.businessDateIsLong,
                taxRegPic: this.setImgSrc(this.bisicmsg.businessLicencePic),
                taxRegNo: this.bisicmsg.taxRegNo,
                taxIssueDate: this.bisicmsg.taxIssueDate,
                orgCodePic: this.bisicmsg.orgCodePic,
                orgCode: this.bisicmsg.orgCode,
                orgCodeDateStart: this.bisicmsg.orgnize[0],
                orgCodeDateEnd: this.bisicmsg.orgnize[1],
                orgCodeDateIsLong: this.bisicmsg.orgCodeDateIsLong,
                clpIdPhotoFront: this.bisicmsg.clpIdPhotoFront,
                clpIdPhotoBack: this.setImgSrc(this.bisicmsg.clpIdPhotoBack),
                clpIdNo: this.bisicmsg.clpIdNo,
                clpIdDateStart: this.bisicmsg.idate[0],
                clpIdDateEnd: this.bisicmsg.idate[1],
                clpIdIsLong: this.bisicmsg.clpIdIsLong,
                enterprisesTaxType: this.bisicmsg.enterprisesTaxType,
                generalTaxpayerQualificationPic: this.setImgSrc(this.bisicmsg.generalTaxpayerQualificationPic),
                grqNo: this.bisicmsg.grqNo,
                grqDateStart: this.bisicmsg.cardate[0],
                grqDateEnd: this.bisicmsg.cardate[1],
                grqDateIsLong: this.bisicmsg.grqDateIsLong,
                baolPic: this.setImgSrc(this.bisicmsg.baolPic),
                baolApprovalNumber: this.bisicmsg.baolApprovalNumber,
                baolDateStart: this.bisicmsg.hedate[0],
                baolDateEnd: this.bisicmsg.hedate[1],
                baolDateIsLong: this.bisicmsg.baolDateIsLong,
                businessGoodsClasses: businessGoodsClasses,
                platformFeeRatio: this.bisicmsg.platformFeeRatio,
                operationalQualificationPic: this.setImgSrc(this.bisicmsg.operationalQualificationPic),
                oqDateStart: this.bisicmsg.yydate[0],
                oqDateEnd: this.bisicmsg.yydate[1],
                oqDateIsLong: this.bisicmsg.oqDateIsLong,
                brandName: this.bisicmsg.brandName,
                brandLogo: this.setImgSrc(this.bisicmsg.brandLogo),
                // merchantState: '',
                merchantShortName: this.bisicmsg.merchantShortName,
                merchantLogo: this.bisicmsg.merchantLogo,
                isAgent: this.bisicmsg.isAgent,
                powerOfAttorney: this.bisicmsg.powerOfAttorney,
                businessQualificationCompany: this.bisicmsg.qiarr.map((item, index) => {
                  item.no = index + 1
                  return item
                }),
                businessQualificationSpecial: this.bisicmsg.specialArr.map((item, index) => {
                  item.no = index + 1
                  item.qualification_type = item.qualification.join('/')
                  return item
                }),
                merchantUserId: this.$store.state.userId
              }
              this.$tkAjax.post(`${this.$config.baseUrl}/merchant/saveMerchantByStr`, {}, {
                params: {
                  condition: json,
                  submitFlg: '1'
                }
              }).then(res => {
                this.$message.success(res.data.message)
                this.$router.push('/unsubmit')
                //为商家申请记录页面 提供参数
                this.$store.commit('setMerchant', res.data.content)
                // this.edit()
              }).catch(err => {
                this.$message.warning(err.data.message)
              })
            } else {
              console.log('error submit!!')
              return false
            }
          })
        }
      }
    },
    addpush () {
      let index = this.bisicmsg.arr.length + 1
      this.bisicmsg.arr.push({
        no: index,
        businessGoodsClasses: [],
        platformFeeRatio: ''
      })
    },
    addSpecialArr () {
      this.bisicmsg.specialArr.push({
        qualification_type: [],
        // certificate: '',
        qualification_date: '',
        qualification_pic: ''
      })
    },
    qishanSpecial (index) {
      if (this.bisicmsg.specialArr.length > 0) {
        this.bisicmsg.specialArr.splice(index, 1)
      }
      // } else {
      //   this.$message.warning('最少有一个')
      // }
    },
    changePercentageNew () {
      if (this.bisicmsg.pwfPercentageNew.indexOf('.') === -1) {
        this.bisicmsg.pwfPercentageNew = (this.bisicmsg.pwfPercentageNew * 1).toFixed(2)
      }
    },
    //点击查看 显示页面
    init () {
      this.$tkAjax.get(`${this.$config.baseUrl}/merchant/merchantApplyRecord/getMerchantApplyRecordById?applyRecordId=` + this.$route.query.id).then(res => {
        // if (!res.data.content) {
        //   this.$message.warning('没有检索到信息')
        //   return false
        // }
        if (res.data.content) {
          Object.assign(this.bisicmsg, res.data.content)
        }
        this.bisicmsg.pwfPercentageNew = (this.bisicmsg.pwfPercentageNew * 1).toFixed(2)
        this.$set(this.bisicmsg, 'busying', [res.data.content.businessLicenceDateStart, res.data.content.businessLicenceDateEnd])
        this.$set(this.bisicmsg, 'orgnize', [res.data.content.orgCodeDateStart, res.data.content.orgCodeDateEnd])
        this.$set(this.bisicmsg, 'idate', [res.data.content.clpIdDateStart, res.data.content.clpIdDateEnd])
        this.$set(this.bisicmsg, 'cardate', [res.data.content.grqDateStart, res.data.content.grqDateEnd])
        this.$set(this.bisicmsg, 'hedate', [res.data.content.baolDateStart, res.data.content.baolDateEnd])
        this.$set(this.bisicmsg, 'yydate', [res.data.content.oqDateStart, res.data.content.oqDateEnd])
        this.verifyState = res.data.content.verifyState
        this.bisicmsg.arr = res.data.content.businessGoodsClasses.split(',').map(item => {
          let subArr = item.split('&*&')
          return {
            businessGoodsClasses: subArr[0].split('/'),
            platformFeeRatio: subArr[1] || ''
          }
        })
        res.data.content.businessQualificationCompany = JSON.parse(res.data.content.businessQualificationCompany)
        if (Array.isArray(res.data.content.businessQualificationCompany)) {
          this.bisicmsg.qiarr = res.data.content.businessQualificationCompany.map((item, index) => {
            item.qualification_date = new Date(item.qualification_date)
            item.no = index + 1
            return item
          })
        }
        res.data.content.businessQualificationSpecial = JSON.parse(res.data.content.businessQualificationSpecial)
        if (Array.isArray(res.data.content.businessQualificationSpecial)) {
          this.bisicmsg.specialArr = res.data.content.businessQualificationSpecial.map((item, index) => {
            item.qualification_date = new Date(item.qualification_date)
            if (item.qualification_type) {
              item.qualification = item.qualification_type.split('/')
            } else {
              item.qualification = []
            }
            item.no = index + 1
            return item
          })
        }
        if (this.$route.query.look === 0) {
          this.$set(this.bisicmsg, 'pwfPercentage', this.bisicmsg.pwfPercentageNew)
        }
        this.$refs.bisicmsg.clearValidate(Object.keys(this.rules2))
        this.city(this.bisicmsg.businessLicenceProvince, true)
        this.qu(this.bisicmsg.businessLicenceCity, true)
      }).catch(err => {
        console.log(err)
        // this.$message.warning(err.data.message)
      })
    },
    cancel () {
      this.shis = []
      this.qus = []
      //企业基本信息
      this.bisicmsg.merchantName = ''
      this.bisicmsg.companyIntroduction = ''
      this.bisicmsg.companyBusinessScope = ''
      this.bisicmsg.companyLegalPerson = ''
      this.bisicmsg.companyRegCapital = ''
      this.bisicmsg.companyEstablistTime = ''
      this.bisicmsg.businessLicenceProvince = ''
      this.bisicmsg.businessLicenceCity = ''
      this.bisicmsg.businessLicenceCounty = ''
      this.bisicmsg.businessLicenceAddress = ''
      //企业资质信息
      this.bisicmsg.businessLicenceType = ''
      this.bisicmsg.businessLicencePic = ''
      this.bisicmsg.businessLicenceRegNo = ''
      this.bisicmsg.busying = []//营业期限
      this.bisicmsg.businessDateIsLong = ''
      this.bisicmsg.taxRegPic = ''//税务登记照
      this.bisicmsg.taxRegNo = ''
      this.bisicmsg.taxIssueDate = ''
      this.bisicmsg.orgCodePic = ''//组织机构代码照
      this.bisicmsg.orgCode = ''
      this.bisicmsg.orgnize = []
      this.bisicmsg.orgCodeDateIsLong = ''
      this.bisicmsg.clpIdPhotoFront = ''//企业法人身份证照
      this.bisicmsg.clpIdPhotoBack = ''
      this.bisicmsg.clpIdNo = ''
      this.bisicmsg.idate = []
      this.bisicmsg.clpIdIsLong = ''
      //企业纳税信息
      this.bisicmsg.enterprisesTaxType = ''
      this.bisicmsg.generalTaxpayerQualificationPic = ''
      this.bisicmsg.baolPic = ''
      this.bisicmsg.baolApprovalNumber = ''
      //品牌信息
      this.bisicmsg.brandName = ''
      this.bisicmsg.brandLogo = ''
      //商家信息
      this.bisicmsg.merchantShortName = ''
      this.bisicmsg.merchantLogo = ''
      this.bisicmsg.isAgent = ''
      this.bisicmsg.powerOfAttorney = ''
      //经营范围
      this.bisicmsg.arr = [
        {
          businessGoodsClasses: [],
          platformFeeRatio: ''
        }
      ]
      //企业经营信息
      this.bisicmsg.qiarr = [
        {
          no: '1',
          qualification_type: [],
          qualification_date: '',
          qualification_pic: ''
        }
      ]
      //特殊品类
      this.bisicmsg.specialArr = []
      this.$forceUpdate()
    },
    //企业资质信息
    handleAvatarSuccess (res, file) {
      if (res.code === '200') {
        this.bisicmsg.businessLicencePic = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    handleAvatarSuccess1 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.taxRegPic = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    handleAvatarSuccess2 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.orgCodePic = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    handleAvatarSuccess3 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.clpIdPhotoFront = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    handleAvatarSuccess4 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.clpIdPhotoBack = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    //企业纳税信息
    handleAvatarSuccess5 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.generalTaxpayerQualificationPic = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    handleAvatarSuccess6 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.baolPic = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    //品牌信息
    handleAvatarSuccess7 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.brandLogo = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    //商家信息
    hostSuccess (res, file) {
      if (res.code === '200') {
        this.bisicmsg.merchantLogo = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    empowerSuccess (res, file) {
      if (res.code === '200') {
        this.bisicmsg.powerOfAttorney = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    //经营范围
    handleAvatarSuccess0 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.operationalQualificationPic = this.getImgSrc(res.content)
      } else {
        this.$message.warning(res.message)
      }
    },
    //企业运营资质
    qiadd () {
      this.bisicmsg.qiarr.push({
        qualification_type: [],
        qualification_date: '',
        qualification_pic: ''
      })
    },
    //企业运营资质 删除
    qishan (index) {
      if (this.bisicmsg.qiarr.length > 1) {
        this.bisicmsg.qiarr.splice(index, 1)
      } else {
        this.$message.warning('最少有一个')
      }
    },
    //企业经营资质
    jingup (index) {
      this.serviceIndex = index
    },
    //企业经营资质
    jingSuccess (res, file) {
      if (res.code === '200') {
        this.bisicmsg.qiarr[this.serviceIndex].boname = file.name
        this.bisicmsg.qiarr[this.serviceIndex].qualification_pic = res.content
      } else {
        this.$message.warning(res.message)
      }
    },
    //特殊品类商品
    jingSuccess1 (res, file) {
      if (res.code === '200') {
        this.bisicmsg.specialArr[this.serviceIndex].boname1 = file.name
        this.bisicmsg.specialArr[this.serviceIndex].qualification_pic = res.content
      } else {
        this.$message.warning(res.message)
      }
    },
    beforeAvatarUpload (file) {
      const isJPG = (file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif')
      const isLt2M = file.size / 1024 / 1024 < 2
      // if (!isJPG) {
      //   this.$message.error('上传头像图片只能是 JPG 格式!');
      // }
      if (!isLt2M) {
        this.$message.error('上传头像图片大小不能超过 1MB!')
      }
      return isJPG && isLt2M
    }
  }
}
</script>
<style lang="scss" scoped>
.changeapply {
  .form1 {
    width: 66%;
    color: #000;
    .isdai {
      margin-top: 14px;
    }
    .minibo.is-error {
      margin-bottom: 0;
      .el-form-item__content {
        .el-form-item__error {
          margin-top: 24px;
          // width: 170px;
        }
      }
    }
    .qiying {
      .qizeng {
        .el-form-item__content {
          .shach {
            .uplod {
              .avatar-uploader-icon {
                width: 100px;
                height: 100px;
                line-height: 100px;
                border: 1px dashed #ccc;
              }
              .avatar {
                vertical-align: middle;
                display: block;
                width: 100px;
                height: 100px;
              }
            }
          }
        }
      }
    }
    .red {
      color: #f00;
      font-size: 15px;
      padding-left: 56px;
      span {
        padding-left: 19px;
      }
    }
    .protocol {
      display: flex;
      padding-top: 10px;
      .xieyi {
        padding-left: 10px;
        font-size: 15px;
      }
    }
    .pubselect {
      .el-form-item__content {
        display: flex;
        .publis {
          width: 92%;
          margin-right: 20px;
        }
        .jing {
          display: block;
          color: #f00;
          font-size: 12px;
        }
      }
      .wrap {
        padding-bottom: 20px;
        .el-cascader {
          width: 90%;
        }
        .dele {
          margin-left: 20px;
        }
      }
    }
    .content{
      margin-left:164px;
      .tageitm {
        .el-form-item__content {
          .input{
            width: 36%;
            margin-right: 5px;
          }
          // .el-form-item__error {
          //   left: 67px;
          // }
        }
      }
    }
    .proces {
      display: flex;
      .local1 {
        .el-form-item__content {
          margin-left: 148px;
        }
      }
    }
    .el-form-item__content .el-upload__tip.redicon {
      color: #f00;
      margin-top: 0;
    }
  }
  .form3 {
    .licensePic {
      .el-form-item__content {
        .twoface {
          display: flex;
          .avatar-uploader {
            width: 35%;
          }
          .redicon {
            width: 200%;
          }
        }
        .avatar-uploader-icon {
          width: 100px;
          height: 100px;
          line-height: 100px;
          border: 1px dashed #ccc;
        }
      }
      .uplod {
        .el-upload-dragger{
          width: 100px;
          line-height: 100px;
          height: 100px;
          border: 1px dashed #2D6DE7;
        }
        .avatar {
          vertical-align: middle;
          display: block;
          width: 100px;
          height: 100px;
        }
      }
    }
    .lia {
      padding-bottom: 15px;
    }
    .dates {
      // margin-bottom: 0;
      .line {
        margin-left: 28px;
      }
      .el-date-editor.el-input {
        width: 200px;
      }
      .longtime {
        float: right;
      }
    }
    .redic {
      color: #f00;
      font-size: 12px;
      padding-left: 148px;
    }
    .addgoodstype {
      padding: 0 0 20px 147px;
      .descrip {
        color: #f00;
        font-size: 12px;
        margin-left: 20px;
      }
    }
  }
  .buttons {
    text-align: center;
    .el-button {
      border-radius: 4px;
    }
  }
}
</style>
